package com.oa.demo.server.test;

import com.oa.demo.annotation.BaseCloudApplication;
import com.oa.demo.annotation.EnableBaseAuthExceptionHandler;
import com.oa.demo.annotation.EnableOauth2FeignClient;
import com.oa.demo.annotation.EnableServerProtect;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;

/**
 * @author 孔德成
 * @date 2020/11/23 14:40
 */
//开启feign功能
@EnableFeignClients
@SpringBootApplication

@EnableDiscoveryClient
//开启Spring Cloud Security权限注解
@EnableGlobalMethodSecurity(prePostEnabled = true)
////认证类型异常翻译
//@EnableBaseAuthExceptionHandler
////开启带令牌的Feign请求，避免微服务内部调用出现401异常
//@EnableOauth2FeignClient
////开启微服务防护，避免客户端绕过网关直接请求微服务
//@EnableServerProtect
@BaseCloudApplication
public class ServerTestApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServerTestApplication.class).start();
    }
}
